# Go parameters
CMD=go
BUILD=$(CMD) build -ldflags="-w -s"
BTest=$(CMD) build -gcflags "all=-N -l"
CLEAN=$(CMD) clean
BINARY_NAME=mbox
BINARY_UNIX=$(BINARY_NAME)
BINARY_WINDOWS=$(BINARY_NAME).exe

all:

clean:
	$(CLEAN)

build-web:
	npm --prefix ./ui/mbox run build-only

build-desk:
	npm --prefix ./ui/desk run make && cp -r ./ui/desk/out/mbox-win32-x64/* ./public/electron

build:
	$(BUILD) -ldflags="-H=windowsgui" -o $(BINARY_WINDOWS) -v

build-all: build-web build-desk build

android:
	GOOS=linux GOARCH=arm64  CGO_ENABLED=1  $(BUILD)  -o $(BINARY_UNIX) -v

build-server:
	$(BUILD) -ldflags="-H=windowsgui"  -o $(BINARY_WINDOWS) -v

linux:
	GOOS=linux $(BUILD) -o $(BINARY_UNIX)  -v

deps:
	$(CMD) mod tidy

.PHONY:
